package com.itcast.demo_one.kotlin

// 定义全局的常量
const val name = "张三"

fun main() {
    // 1. 定义常量
    // val name = "张三"
    // name = "李四"
    // println(name)

    // 2. 定义变量
    /*var age = 18
    age = 19
    println(age)*/

    /*var num1 = 100
    var num2 = 200
    val sum = num1 + num2
    // const val sum = 100
    println(sum)*/

    // 3. 类型推导
    /*var age: Int = 18
    var name: String = "张三"
    var grade: Char = 'A'*/

    // 4. 字符串拼接
    var name = "张三"
    var age = 18
    println("我的名字是：$name, 年龄是：${age+5}")
}